{% extends "base.html" %}
{% load i18n %}
{% block title %} Tu Negocio Empresarios - Pagos Cliente {% endblock %}

{% block head-css-ext %}
    <link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}css/layout.css" media="screen" />
    <link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}css/blue/style.css" media="print, projection, screen" />
{% endblock %}

{% block head-js-ext %}
    <script type="text/javascript" src="{{MEDIA_URL}}js/jquery.js"></script>
    <script type="text/javascript" src="{{MEDIA_URL}}js/jquery.tablesorter.js"></script>
    <script type="text/javascript" src="{{MEDIA_URL}}js/jquery.tablePagination.js"></script>
    <script type="text/javascript" src="{{MEDIA_URL}}js/jquery.translate.js"></script>
{% endblock %}

{% block head-js-embedded %}
    <script type="text/javascript">
        $(document).ready(function(){
            var options = {
                firstArrow : (new Image()).src="{{MEDIA_URL}}img/icons/first.png",
                prevArrow : (new Image()).src="{{MEDIA_URL}}img/icons/prev.png",
                lastArrow : (new Image()).src="{{MEDIA_URL}}img/icons/last.png",
                nextArrow : (new Image()).src="{{MEDIA_URL}}img/icons/next.png"
            }
            $("#pagos")
                .tablesorter({widthFixed: true,  widgets: ['zebra'], headers: { 2 : {sorter: false}, 3 : {sorter: false}, 4 : {sorter: false}, 5 : {sorter: false} } })
                .tablePagination(options);		
            $("#tablePagination").translate('en', 'es');
        });        
    </script>
{% endblock %}

{% block content-box1 %}
    {% if ventas %}
        <div id="testTable"
            <table id="pagos" class="tablesorter">
                <thead>
                    <tr align="center">
                        <th>Cliente&nbsp;&nbsp;&nbsp;</th>
                        <th>Valor Total Vendido</th>
                        <th>Saldo Actual</th>
                        <th>Registrar Pago Cliente</th>
                        <th>Ver Pagos Cliente</th>
                    </tr>            
                </thead>
                <tbody>
                    {% for venta in ventas %}               
                        <tr align="center">
                            <td>{{ venta.cliente}}</td>
                            <td>{{ venta.valor }}</td>
                            <td>{{ venta.saldo}}</td>
                            <td><a href="{% url registrar_pago_cliente venta.cliente.codigo %}" title="Registrar Pago Cliente"><img src="{{MEDIA_URL}}/img/pencil.png" border="0"/></a></td>
                            <td><a href="{% url ver_pagos_clientes venta.cliente.codigo %}" title="Ver Pagos Cliente"><img src="{{MEDIA_URL}}/img/zoom.png" border="0"/></a></td>
                        </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    {% else %}
        <p><b>No tiene Ventas hechas hasta el momento</b></p>
    {% endif %}
{% endblock %}

{% block content-colum2 %}
    {% if user.is_authenticated %}
        <ul>
            <li><a href="{% url index %}">{% trans "Home" %}</a></li>
            <li><a href="{% url clientes %}">Clientes</a></li>
            <li><a href="{% url listar_clientes %}">Listar Clientes</a></li>
        </ul>
    {% endif %}   
{% endblock %}